package ii.zjf.week4.count;

import java.util.concurrent.locks.LockSupport;

public class Add4 extends BaseAdd {

    public static void main(String[] args) throws InterruptedException {

        Thread currentThread = Thread.currentThread();

        Thread thread = new Thread(() -> {

            count.add();

            LockSupport.unpark(currentThread);
        });

        thread.start();

        LockSupport.park();

        System.out.println("success : " + count.getCount());

    }
}
